package jy.game.tools;

import java.util.Arrays;
import java.util.List;

import jy.game.components.wuxue.SkillCoverType;

public class CommonSettings {
    public static int          MAX_SKILL_LEVEL          = 50;
    public static int          MAX_INTERNALSKILL_LEVEL  = 40;
    public static int          MOD_KEY                  = 1;
    public static int          MAX_ATTRIBUTE            = 3000;
    public static String       persistentDataPath       = "";
    public static List<String> RoleAttributeList        = Arrays.asList("hp",
        "maxhp",
        "maxhppercent",
        "mp",
        "maxmp",
        "maxmppercent",
        "gengu",
        "bili",
        "fuyuan",
        "shenfa",
        "dingli",
        "wuxing",
        "quanzhang",
        "jianfa",
        "daofa",
        "qimen",
        "female",
        "wuxue"
    );
    // Token: 0x040000A0 RID: 160
    public static List<String> RoleAttributeChineseList = Arrays.asList("生命",
        "生命上限",
        "生命上限百分率",
        "内力",
        "内力上限",
        "内力上限百分率",
        "根骨",
        "臂力",
        "福缘",
        "身法",
        "定力",
        "悟性",
        "搏击格斗",
        "使剑技巧",
        "耍刀技巧",
        "奇门兵器",
        "是否女性",
        "武学常识");

    public static int LevelupExp(int level) {
        if (level <= 0) {
            return 0;
        }
        return (int) (level * 20 + 1.1 * CommonSettings.LevelupExp(level - 1));
    }

    public static String AttributeToChinese(String attr) {
        int i = 0;
        for (String s : CommonSettings.RoleAttributeList) {
            if (s.equals(attr)) {
                return CommonSettings.RoleAttributeChineseList.get(i);
            }
            i++;
        }
        return null;
//        throw new Exception("invalid attribute " + attr);
    }

    public static SkillCoverType GetDefaultCoverType(int skillTypeCode) {
        switch (skillTypeCode) {
            case 0:
                return SkillCoverType.NORMAL;
            case 1:
                return SkillCoverType.LINE;
            case 2:
                return SkillCoverType.FAN;
            case 3:
                return SkillCoverType.CROSS;
            case 5:
                return SkillCoverType.STAR;
            default:
                return SkillCoverType.NORMAL;
        }
    }

    public static String getRoleName(String roleKey) {
        return "";
//        String result = "";
//        if (roleKey == "女主") {
//            result = RuntimeData.Instance.femaleName;
//        } else {
//            if (!(roleKey == "主角")) {
//                foreach (Role role in RuntimeData.Instance.team) {
//                    if (role.key == roleKey) {
//                        return role.name;
//                    }
//                }
//                foreach (Role role2 in RuntimeData.Instance.Follow) {
//                    if (role2.key == roleKey) {
//                        return role2.name;
//                    }
//                }
//                foreach (Role role3 in RuntimeData.Instance.Temp) {
//                    if (role3.key == roleKey) {
//                        return role3.name;
//                    }
//                }
//                Role role4 = JyResourceManager.get<Role>(roleKey);
//                if (role4 != null) {
//                    return role4.name;
//                }
//                return roleKey;
//            }
//            result = RuntimeData.Instance.maleName;
//        }
//        return result;
    }

    public interface VoidCallBack {
        void yield();
    }
}
